﻿Imports System.Data.SqlClient
Imports _1065144_1065164.DataProvider
Public Class KhachHangChoThueBUS
    Public Shared Function GetAll() As List(Of KhachHangChoThueDTO)
        Dim listKhachHangChoThue As List(Of KhachHangChoThueDTO)

        listKhachHangChoThue = KhachHangChoThueDAO.GetAll()

        Return listKhachHangChoThue
    End Function
    Public Shared Sub Insert(ByVal sqlparameters As SqlParameter())
        KhachHangChoThueDAO.Insert(sqlparameters)
    End Sub

    Public Shared Sub Update(ByVal sqlparameters As SqlParameter())
        KhachHangChoThueDAO.Update(sqlparameters)
    End Sub
    Public Shared Sub Delete(ByVal sqlparameters As SqlParameter)
        KhachHangChoThueDAO.Delete(sqlparameters)

    End Sub

    Public Shared Function TimTheoTen(ByVal ten As String) As List(Of KhachHangChoThueDTO)
        Dim listKhachThue As List(Of KhachHangChoThueDTO)
        Dim sqlParameter As SqlParameter = New SqlParameter("hoten", SqlDbType.NVarChar)
        sqlParameter.Direction = ParameterDirection.Input
        sqlParameter.Value = ten

        listKhachThue = KhachHangChoThueDAO.TimKiemTheoTen(sqlParameter)

        Return listKhachThue
    End Function

    Public Shared Function TimTheoMaChuNha(ByVal ten As String) As List(Of KhachHangChoThueDTO)
        Dim listKhachThue As List(Of KhachHangChoThueDTO)
        Dim sqlParameter As SqlParameter = New SqlParameter("machunha", SqlDbType.NVarChar)
        sqlParameter.Direction = ParameterDirection.Input
        sqlParameter.Value = ten

        listKhachThue = KhachHangChoThueDAO.TimTheoMaChuNha(sqlParameter)

        Return listKhachThue
    End Function

End Class
